﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text) && string.IsNullOrEmpty(textBox2.Text))
            {
                MessageBox.Show("用户名密码不能为空","提示");
            }
            else if (string.IsNullOrEmpty(textBox1.Text))
            {
                MessageBox.Show("用户名不能为空", "提示");
            }
            else if (string.IsNullOrEmpty(textBox2.Text))
            {
                MessageBox.Show("密码不能为空", "提示");
            }
            else
            {
                if (textBox1.Text.Equals("admin") && textBox2.Text.Equals("123456"))
                {
                    MessageBox.Show("登陆成功", "成功");
                }
                else
                {
                    MessageBox.Show("用户名或密码不正确", "失败");
                }
            }
        }
    }
}
